package top.heathylife.gateway.common.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author maoxiaomeng
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "平台系统信息")
public class SystemPo implements Serializable {
    private static final long serialVersionUID = -2330643299644133839L;
    /**
     * 系统名称
     */
    @ApiModelProperty(required = true, value = "系统名称")
    String systemName;
    /**
     * 系统名简称 ，用于保存唯一处理，
     * （系统简称-系统名-应用名）必须保证系统唯一，否则将会报错
     */
    @ApiModelProperty(required = true, value = "系统名简称")
    String shortName;

    @ApiModelProperty(required = true, value = "系统官网")
    String url;

    @ApiModelProperty(required = true, value = "系统简介")
    String desc;

    @ApiModelProperty(required = true, value = "数据更新周期描述")
    String periodValidityDesc;

    @ApiModelProperty(required = true, value = "数据更新周期")
    Long periodValidity;
    /**
     * 获取应用名称
     * 应用名称不用填写
     * 直接在配置文件中获取 spring.application.name的值进行填充，为了方便restTemplate远程调用
     */
    @ApiModelProperty(value = "服务名称")
    String applicationName;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "服务启动时间")
    LocalDateTime startTime;

    @ApiModelProperty(value = "接口数量")
    Integer interfaceCount;

    @ApiModelProperty(value = "具体的接口信息")
    List<ParentApiPo> apis;
}
